// ================================START====================================
// Template generated from		FRAMEWORKIVY CODE GENERATOR
// Generator Version:			<1.0.0.0>
// Template Creation Time:		<Thursday, 26 May, 2016   12:32:16 AM>
// Template Modification Time:	<Monday, 23 May, 2016   11:22:57 PM>
// Code Generation Time:		<Thursday, 26 May, 2016   12:56:06 AM>
// Workstation ID:				<PRAVESH>
// Current system User ID:		<pravesh kr>
// Entity/Table Name:			<Subscription>
// ModuleName:			        <SiteGeneralBasic>
// Description:					<CSharp Class For Entity Dao Unit Test>
// Template File:				<IvyGodeGenDefaultTemplate V1.1.xml>

// Please modify the generated code as per requirement.
// This code generator is just to speed up the stereo type codes
// Complex logic needs to be modified manually.

// This block of comments will not be included in
// the definition of the procedure.
// =========================================================================

using System;

//This Class specific System namespaces
using Microsoft.VisualStudio.TestTools.UnitTesting;

//This Class Specific IvyFramework namespaces
using Ivy.Common.Framework.Base;
using Ivy.Common.Framework.DataAccess;
using Ivy.Common.Framework.GeneralUtility;

using Ivy.SiteGeneralBasic.Entity;
using Ivy.SiteGeneralBasic.DataAccess;

namespace Ivy.SiteGeneralBasic.UnitTest
{
    [TestClass]
    public class SubscriptionDaoUnitTest
    {
        [TestMethod]
        public void SubscriptionInsertTestMethod()
        {
            Subscription _tempSubscription = new Subscription();
            SubscriptionDao _SubscriptionDao = new SubscriptionDao();

            //Auto Generated attribute should not be supplied from outside.
            //_tempSubscription.SubscribKey = ???; This is Auto Generated attribute.

            _tempSubscription.SubscribItemCode = StringUtility.GenerateRandomNumber(); //Unique Key
            _tempSubscription.SubscribItemDescription = "TEST SubscribItemDescription Not Unique" ;
            _tempSubscription.SubscribUserMailID = "TEST SubscribUserMailID Unique_" + StringUtility.GenerateRandomString(6); //Unique Key
            _tempSubscription.SubscrbDate = DateTime.Now; //Not Unique Key

            _tempSubscription.Sys_CreatedByID = "1";
            _tempSubscription.Sys_DeleteType = DeleteType.SoftDeleteOnly;
            _tempSubscription.Sys_IsDeleted = false;
            _tempSubscription.Sys_OrganizationID = -1;

            Assert.IsTrue(_SubscriptionDao.Insert(_tempSubscription));
        }

        [TestMethod]
        public void SubscriptionUpdateTestMethod()
        {
            Subscription _tempSubscription = new Subscription();
            SubscriptionDao _SubscriptionDao = new SubscriptionDao();

            //Please edit and provide a valid value for GetByPrimaryKey() parameter
            _tempSubscription = _SubscriptionDao.GetByPrimaryKey(int_SubscribKey); 

            _tempSubscription.SubscribItemCode = StringUtility.GenerateRandomNumber(); //Unique Key
            _tempSubscription.SubscribItemDescription = "TEST SubscribItemDescription Not Unique" ;
            _tempSubscription.SubscribUserMailID = "TEST SubscribUserMailID Unique_" + StringUtility.GenerateRandomString(6); //Unique Key
            _tempSubscription.SubscrbDate = DateTime.Now; //Not Unique Key

            _tempSubscription.Sys_ModifiedByID = "1";

            Assert.IsTrue(_SubscriptionDao.Update(_tempSubscription));
        }

    }
}


